package com.tx.admin.util.common;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.reflect.MethodSignature;

public class AopUtil {

	public static Map<String,Object> getParams(ProceedingJoinPoint pjp){
		MethodSignature ms = (MethodSignature) pjp.getSignature();
		Map<String,Object> params = new HashMap<>();
        String[] keys = ms.getParameterNames();
        Object[] values = pjp.getArgs();
        for(int x = 0 ; x < values.length; x++) {
        	  params.put(keys[x], values[x]);
        }
	    return params;
	}
}
